/*
 * @Description: 档案备份计划导航包裹组件
 * @Author: Rfan
 * @Date: 2022-08-03 20:29:15
 * @LastEditTime: 2022-08-12 10:21:18
 */

import { useBackupContext } from '../contexts/BackupContext';
import UFANav, { IUFAChangeCallback } from '@/components/UFANav';

const NavSidebar = () => {
  const { setSelectFondId, setSelectAT, setSelectATId } = useBackupContext();

  /**
   * @description: 切换导航方法
   * @param {IUFAChangeCallback} param1 选中档案类型及所属全宗
   */
  const navChange = ({ fondId, fondItem, atId, atItem }: IUFAChangeCallback) => {
    console.log('change', { fondId, fondItem, atId, atItem });
    setSelectFondId(fondId);
    setSelectAT(atItem);
    setSelectATId(atId);
  };

  return (
    <>
      <UFANav onChange={navChange} />
    </>
  );
};

export default NavSidebar;
